package com.itLrg.blog.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.Widget;


public class Header extends Composite
{

   private static HeaderUiBinder uiBinder = GWT.create(HeaderUiBinder.class);

   interface HeaderUiBinder extends UiBinder<Widget, Header>
   {
   }
   
   private static LoginUiBinder loginuiBinder = GWT.create(LoginUiBinder.class);
   
   @UiTemplate("LoginWidget.ui.xml")
   interface LoginUiBinder extends UiBinder<Widget, LoginWidget> {}
   
   @UiField
   Anchor signinLink;
   
   LoginWidget lowinwidget = new LoginWidget();

   public Header()
   {
      initWidget(uiBinder.createAndBindUi(this));
   }

   public Header(String firstName)
   {
      initWidget(uiBinder.createAndBindUi(this));
   }
   
   @UiHandler("signinLink")
   void clikeSignIn(ClickEvent clickEvent)
   {
      RootLayoutPanel.get().add(loginuiBinder.createAndBindUi(lowinwidget));
   }
}
